Developer Documentation
PATH  WebObjects 4.0 Documentation > WebObjects Tools and Techniques

Table of Contents Previous Section

Creating Dynamic Elements

There are several ways to add dynamic elements to your component.

Using the Toolbar

You create dynamic elements in the same way that you create other elements: by clicking buttons in the toolbar or using the menu commands. In WebObjects Builder, there are two groups of buttons in the switchable toolbar that allow you to create dynamic elements:

Dragging Elements into the Component Window

Some elements can be created by dragging an item from the file system into a component window. These include:

In addition, you can also drag a model file (of type .eomodeld) into a component to create a variable of type WODisplayGroup (see "Adding Display Groups").

Certain file types (such as .gif, .jpeg, .tif, .eps, and .bmp) are automatically recognized by WebObjects Builder. The Preferences Panel (which you display by choosing Tools Options) shows a list of file extensions that WebObjects Builder accepts. You can drag any item with one of those file extensions into a component window, and the item will be added to your project. You can add file types if you need them.

Using the Add WebObject Panel

The Add WebObject panel is an advanced feature for those who wish to work in source editing mode. It allows you to add a dynamic element and set its bindings by hand.

  1. In other source editing or graphical mode, place the cursor at the point in the HTML template where you want to add the element.

  2. Choose Tools Add WebObject.

    A panel appears that allows you to create a dynamic element by entering its class and its name. The name is used by the HTML template and declarations (.wod) file to uniquely identify the element. (Normally, you allow WebObjects Builder to generate names for you, but if you add elements in source editing mode, you must specify their names.)

  3. Click Add.

    The element appears in the HTML template.

Table of Contents Next Section